package ltd.jdsoft.cute.spring.web.exception;

/**
 * 业务异常，方便拦截器区分做统一处理
 * 
 * @author zhengzhq
 *
 */
public class BizException extends RuntimeException {

  private static final long serialVersionUID = -8743564606269908676L;
  private ExceptionEnum exceptionEnum;
  // 扩展异常信息，提示到调用端将会覆盖enum类型中的描述
  private String extraErrorMsg;

  public BizException(ExceptionEnum exceptionEnum) {
    this.exceptionEnum = exceptionEnum;
  }

  public BizException(ExceptionEnum exceptionEnum, String extraErrorMsg) {
    this.exceptionEnum = exceptionEnum;
    this.extraErrorMsg = extraErrorMsg;
  }

  public ExceptionEnum getExceptionEnum() {
    return this.exceptionEnum;
  }

  public String getExtraErrorMsg() {
    return this.extraErrorMsg;
  }
}
